package com.sh.data.engine.application.model.request.management;

import com.sh.data.engine.common.annotation.crypto.EncryptField;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author: mengzheng.mhc
 * @date: 2024/6/24 11:40
 */
@Data
@Schema
public class StorageConnectionRequest {

    @Schema(description = "存储id", requiredMode = RequiredMode.NOT_REQUIRED)
    private Long storageId;

    @Schema(description = "存储类型", requiredMode = RequiredMode.REQUIRED)
    @NotBlank(message = "存储类型不能为空")
    private String storageType;

    @Schema(description = "jdbc连接", requiredMode = RequiredMode.REQUIRED)
    @NotBlank(message = "url地址不能为空")
    private String storageLink;

    @Schema(description = "用户名", requiredMode = RequiredMode.REQUIRED)
    @NotBlank(message = "用户名不能为空")
    private String username;

    @Schema(description = "密码", requiredMode = RequiredMode.REQUIRED)
    @NotBlank(message = "密码不能为空")
    @EncryptField
    private String password;

    @Schema(description = "Sap类型时需要送schema")
    private String sapSchema;

    @Schema(title = "hive-site.xml文件的地址", description = "仅存储源为Hive时传递此参数")
    private String hiveSiteAddress;
}
